package com.group.library.order.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.group.library.order.dao.AdviceMapper;
import com.group.library.order.entity.Advice;
import com.group.library.order.service.AdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdviceServiceImpl implements AdviceService {

    @Autowired
    private AdviceMapper adviceMapper;

    @Override
    public PageInfo<Advice> findAdvice(Integer page, Integer limit, String name, String number) {
        PageHelper.startPage(page,limit);
        List<Advice> advices = adviceMapper.findAdvice(name,number);
        System.out.println("advices-->"+advices);
        return new PageInfo<Advice>(advices);
    }
}
